<template>
   <!-- 投标项目工程量清单差异及盈亏分析表 -->
    <a-form-model
      ref="ruleForm"
      :model="form"
      :label-col="{ span: 6 }"
      :wrapper-col="{ span: 18 }"
      :rules="editModel == 0 ? {} : rules"
      :class="editModel == 0?'':'rulesForm'"
    >
      <a-spin :spinning="loading">
        <!-- 表格 -->
        <a-card :bordered="false">
          <title-name title="投标项目工程量清单差异及盈亏分析表"></title-name>
          <div class="mb20" v-if="editModel != 0">
            <ExcelImportButton
              ref="excelImportButton"
              :loading="importLoading"
              icon="import"
              button-text="批量导入"
              v-if=" hideBuquBtn()"
              @handleSubmit="handleImport"
            />
            <ExportMould
              v-if="hideBuquBtn()"
              class="ml20"
              button-text="下载导入模板"
              template-code="投标项目工程量清单差异及盈亏分析表.xlsx"
              icon="cloud-download"
            />
          </div>
           <custom-form class="planProfitLossAnalyses" :formList="formList" :form="form" :is-emit="false" :editModel="editModel == 0 ? '' : ''">
            <template v-slot:table>
              <a-form-model-item class="formTable" label=" " :colon="false">
                <a-table :scroll="{ x: 1300 }" :class="form.planProfitLossAnalyses.length>1?'lastTable':''"
                  ref="formTable"
                  bordered
                  :columns="columns"
                  :data-source="form.planProfitLossAnalyses"
                  :pagination="false"
                >
                  <template
                    v-for="col in ['name', 'unitOfMeasurement', 'bidQuantities', 'bidUnitPrice', 'bidTotalPrice',
                    'costQuantities','costUnitPrice','costTotalPrice','profitAndLoss','biddingStrategy','countermeasures','remarks']"
                    :slot="col"
                    slot-scope="text, record"
                  >
                    <div :key="col" class="form-item">
                      <template>
                        <template>
                          <BaseInput
                            v-if="col === 'name' || col === 'biddingStrategy' || col === 'remarks' || col === 'countermeasures' || col === 'unitOfMeasurement'"
                            v-model="record[col]"
                            :disabled="editModel == 0"
                          ></BaseInput>
                          <BaseInputNumber
                          :min="0"
                          :precision="2"
                            v-else-if="col === 'bidQuantities' || col==='bidUnitPrice' || col==='costQuantities' || col==='costUnitPrice'"
                            v-model="record[col]"
                            :disabled="editModel == 0"
                          >
                          </BaseInputNumber>
                           <BaseInput
                            v-else-if="col === 'bidTotalPrice' || col === 'costTotalPrice' || col === 'profitAndLoss'"
                            v-model="record[col]"
                            :disabled="true"
                          ></BaseInput>
                        </template>
                      </template></div
                  ></template>
                  <template slot="action" slot-scope="text, record, index" v-if="editModel != 0 ">
                    <span v-if="(editModel != 0 && index !=form.planProfitLossAnalyses.length-1) || form.planProfitLossAnalyses.length==1" >
                      <a-popconfirm title="确定要删除?" @confirm="() => del(record, index)">
                        <a>删除</a>
                      </a-popconfirm>
                    </span>
                  </template>
                  <template v-if="editModel != 0" slot="footer">
                    <a-button type="primary" @click="addLine">添加行</a-button>
                  </template>
                </a-table>
              </a-form-model-item>
            </template>
            <!-- 附件上传 -->
            <template #fileInfoList>
              <template v-if="editModel != 0">
                <l-table businessCode="FACE12" :uploadArrys.sync="form.fileInfoList"></l-table>
              </template>
              <file-link v-else :fileList="form.fileInfoList" style="margin-top: -3px"></file-link>
            </template>
          </custom-form>
        </a-card>
      </a-spin>
    </a-form-model>
     
</template>

<script>
import { planProfitLossAnalysisEntityUpdateByPrimaryKeySelective,getPlanProfitLossAnalysisEntityById} from '@/api/projectManagementPlanning/billQuantitie'
import BaseEditPage from '@/views/baseEditPage' // 编辑详情页基础配置
import BSelect from '@/components/BComponents/BSelect'
import { providerData } from './model'
import ExportMould from '@/components/ExportMould'
export default {
  name: 'billQuantitie' + Date.now(),
  extends: new BaseEditPage(),
  components: {
    BSelect,
    ExportMould
  },
  data() {

 this.columns = [
  {
    title: '序号',
    width: 80,
    dataIndex: 'index',
    align: 'center',
    customRender: (value, row, index) => {
    const obj = {
            children: index + 1,
            attrs: {}
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 3;
              obj.children = '合计';
          }
          return obj
        },
  },
  { title: '工程量清单子目名称', dataIndex: 'name', align: 'center', scopedSlots: { customRender: 'name' },width: '200px',

    customRender: (value, row, index) => {
        const obj = {
              children: row.name,
            attrs: {}
          }
         if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
            return <BaseInput vModel={row.name} disabled={this.editModel==0}></BaseInput>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 0;
          }
          return obj
        },
  },
  { title: '计量单位', dataIndex: 'unitOfMeasurement', align: 'center', scopedSlots: { customRender: 'unitOfMeasurement', },width: '200px',

      customRender: (value, row, index) => {
        const obj = {
              children: row.unitOfMeasurement,
            attrs: {}
          }
         if (index < this.form.planProfitLossAnalyses.length-1 || index===0 ) {
            return <BaseInput vModel={row.unitOfMeasurement} disabled={this.editModel==0}></BaseInput>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 0;
          }
          return obj
        },
  },
  { title: '投标价',
     children: [
        { title: '工程量', dataIndex: 'bidQuantities', align: 'center', scopedSlots: { customRender: 'bidQuantities' },width: '200px',
        customRender: (value, row, index) => {
        const obj = {
            children: index + 1,
            attrs: {}
          }
          if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
            return <BaseInputNumber   min={0} precision={2} vModel={row.bidQuantities} disabled={this.editModel==0}></BaseInputNumber>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 3;
              obj.children = `自动计算：${!isNaN(row.bidQuantities)?row.bidQuantities:'0.00'}`;
          }
          return obj
        },},
        { title: '单价(元)', dataIndex: 'bidUnitPrice', align: 'center', scopedSlots: { customRender: 'bidUnitPrice' },width: '200px',
            customRender: (value, row, index) => {
            const obj = {
                children: null,
                attrs: {}
            }
            if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
                return <BaseInputNumber  min={0} precision={2} vModel={row.bidUnitPrice} disabled={this.editModel==0}></BaseInputNumber>;
            }
            if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
                obj.attrs.colSpan = 0;
            }
            return obj
            },
        },
        { title: '合价(元)', dataIndex: 'bidTotalPrice', align: 'center', scopedSlots: { customRender: 'bidTotalPrice',},width: '200px',
            customRender: (value, row, index) => {
            const obj = {
                children: null,
                attrs: {}
            }
            if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
                return <BaseInput disabled  vModel={row.bidTotalPrice}></BaseInput>;
            }
            if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
                obj.attrs.colSpan = 0;
            }
            return obj
            },

        },
    ],
  },
 { title: '测算成本',
   children: [
     { title: '核定工程量', dataIndex: 'costQuantities', align: 'center', scopedSlots: { customRender: 'costQuantities' },width: '200px',
      customRender: (value, row, index) => {
        const obj = {
            children: null,
            attrs: {}
          }
          if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
            return <BaseInputNumber   min={0} precision={2} vModel={row.costQuantities} disabled={this.editModel==0}></BaseInputNumber>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 3;
              obj.children = `自动计算：${!isNaN(row.costQuantities)? row.costQuantities:'0.00'}`;
          }
          return obj
        },

     },
     { title: '单价(元)', dataIndex: 'costUnitPrice', align: 'center', scopedSlots: { customRender: 'costUnitPrice' },width: '200px',
       customRender: (value, row, index) => {
        const obj = {
            children: row.costUnitPrice,
            attrs: {}
          }
          if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
            return <BaseInputNumber  min={0} precision={2} vModel={row.costUnitPrice} disabled={this.editModel==0}></BaseInputNumber>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 0;
          }
          return obj
        },

     },
     { title: '合价(元)', dataIndex: 'costTotalPrice', align: 'center', scopedSlots: { customRender: 'costTotalPrice' },width: '200px',
      customRender: (value, row, index) => {
        const obj = {
            children: index + 1,
            attrs: {}
          }
          if (index < this.form.planProfitLossAnalyses.length-1|| index===0) {
            return <BaseInput  disabled  vModel={row.costTotalPrice}></BaseInput>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.attrs.colSpan = 0;
          }
          return obj
        },},
   ]
  },

  { title: '盈亏额（+、-）', dataIndex: 'profitAndLoss', align: 'center', scopedSlots: { customRender: 'profitAndLoss' },width: '200px',
      customRender: (value, row, index) => {
        const obj = {
            children: null,
            attrs: {}
          }
          if (index < this.form.planProfitLossAnalyses.length-1 || index===0) {
            return <BaseInput  vModel={row.profitAndLoss} disabled></BaseInput>;
          }
          if(index === this.form.planProfitLossAnalyses.length-1 && index>0){
              obj.children = `自动计算：${!isNaN(row.profitAndLoss)? row.profitAndLoss:'0.00'}`;
          }
          return obj
        },

  },
  { title: '投标策略', dataIndex: 'biddingStrategy', align: 'center', scopedSlots: { customRender: 'biddingStrategy' },width: '200px'},
  { title: '应对措施', dataIndex: 'countermeasures', align: 'center', scopedSlots: { customRender: 'countermeasures' },width: '200px'},
  { title: '备注', dataIndex: 'remarks', align: 'center', scopedSlots: { customRender: 'remarks' },width: '300px'},
  { title: '操作', dataIndex: 'action',width: '120px', align: 'center',fixed: 'right',scopedSlots: { customRender: 'action' } }
]
    return {
      providerData,
      loading: false, // 加载控件
      visible: false, //人员选择控件
      editModel: 1, // 操作状态:0 查看;1 编辑

      form: {
       planProfitLossAnalyses: [
          {name:null,unitOfMeasurement: null,bidQuantities:null,bidUnitPrice:null,bidTotalPrice:null,costQuantities:null,costUnitPrice:null,costTotalPrice:null,profitAndLoss:null,
            biddingStrategy:null,
            countermeasures:null,
            remarks:null
          },
        ]
      }, // 表单
      id: '',
      loadingBtn: {
        DELETE: false,
        DRAFT: false,
        SUBMITTED: false,
        REJECTED: false
      },
      rules: {}, // 校验规则
      init: false, // 初始化控件
      // 导入中
      importLoading: false,
      // 手动导入
      isImport: false
    }
  },
  watch: {
      'form.planProfitLossAnalyses':{
        handler (val, oldVal) {
          if(!this.isImport){
          let that = this;
           setTimeout(()=>{
              val.length && that.calculate(val)
           })
          }
    },
    deep: true
      }
  },
  created() {},
  async mounted() {
    await this.getDetailData()
  },
  computed: {
    formList() {
      return [{
          slot: true,
          customItemSlot: true,
          keyName: 'table',
          span: 24
        },
      ]
    }
  },
  methods: {
     calculate(){
      const data = this.form.planProfitLossAnalyses
      let bidTotalPrice = 0, costTotalPrice = 0, profitAndLoss=0;
       data.map((item,index)=>{
           if(item.bidQuantities && item.bidUnitPrice){
              item.bidTotalPrice = (item.bidQuantities * item.bidUnitPrice).toFixed(2);
           }
          if(item.costQuantities && item.costUnitPrice){
              item.costTotalPrice = (item.costQuantities * item.costUnitPrice).toFixed(2);
           }
          if(item.bidTotalPrice && item.costTotalPrice){
              item.profitAndLoss = (item.bidTotalPrice - item.costTotalPrice).toFixed(2);
           }
            if(index<data.length-1){
               //合计的值
              bidTotalPrice += item.bidTotalPrice*1;   // 投标价
              costTotalPrice += item.costTotalPrice*1;   //测算成本
              profitAndLoss= bidTotalPrice - costTotalPrice;  //盈亏额
           }
       })
      if(data.length>=2){
         data[data.length-1].bidQuantities = bidTotalPrice.toFixed(2);
         data[data.length-1].costQuantities = costTotalPrice.toFixed(2);
         data[data.length-1].profitAndLoss = profitAndLoss.toFixed(2);
      }
     },
    //添加行
    addLine() {
        let newArr = {
        name: null,
        unitOfMeasurement: null,
        bidQuantities:null,
        bidUnitPrice:null,
        bidTotalPrice:null,
        costQuantities:null,
        costUnitPrice:null,
        costTotalPrice:null,
        profitAndLoss:null,
        biddingStrategy:null,
        countermeasures:null,
        remarks:null
      }, newArrTwo = this.$clone(newArr)
      if(this.form.planProfitLossAnalyses.length==1){
         this.form.planProfitLossAnalyses.push(newArr)   //数据行
         this.form.planProfitLossAnalyses.push(newArrTwo) //合计行
      }else{
        this.form.planProfitLossAnalyses.push(newArr)
      }
      let formTable = this.form.planProfitLossAnalyses;
      if(formTable.length>2){
       let objArrTwo =  formTable[formTable.length-2];
        for(let key in objArrTwo){
         objArrTwo[key]  = null
         }
      }
    },
    del(data, idx) {
        if(this.form.planProfitLossAnalyses.length===2){
          this.form.planProfitLossAnalyses =[{}]
      }
      this.form.planProfitLossAnalyses.splice(idx, 1)
    },
    validateForm() {
      let flag = false
      this.$refs.ruleForm.validate((e) => {
        if (e) {
          flag = true
        }else {
          this.$message.warning('请填写完所有必填项信息')
        }
      })
      return flag
    },
   getDetailData() {
      // 不为添加时请求详情
      if (this.editModel != 2) {
        this.loading = true
        let reqObj = {
          planId: this.id
        }
        if(this.version){
         reqObj.version = this.version;
        }
        getPlanProfitLossAnalysisEntityById(reqObj)
          .then((res) => {
            this.loading = false
            this.form = { ...this.form, ...res.data }
            this.form.planProfitLossAnalyses = [...this.form.planProfitLossAnalyses,{bidQuantities:null,costQuantities:null,profitAndLoss:null}]
            console.log(res.data)
            let planProfitLossAnalyses = res.data.planProfitLossAnalyses;
            if(!planProfitLossAnalyses || planProfitLossAnalyses.length === 0){  //如果没有值，就是默认添加
               this.form.planProfitLossAnalyses = []
               this.addLine();
              }
            this.$nextTick(() => {
              this.init = true

            })
          })
          .catch(() => {
            this.loading = false
          })

      } else {
        this.$nextTick(() => {
          this.init = true
        })
      }
    },
    sure(str){
      let that = this;
      this.$confirm({
          okText: '确认',
          okType: 'warning',
          cancelText: '取消',
          title: '提交?',
          content: `请确认是否要提交?`,
          onOk() {
              that.submitFn(str);
          },
          onCancel() {
          },
        })
    },
     /**
     * 提交表单验证
     */
    isEmpty(obj) {
      if ((typeof obj == 'undefined' || obj == null || obj == '' ) && obj!== 0) {
        return true
      } else {
        return false
      }
    },
    billQuantitieSaveDrafts(formBase) {  //保存草稿
     this.submitFn(1);
    },
    /**
     * @description: 表格数字列校验
     * @param {array} list 表格数据
     * @param {array} fields 需要校验的字段
     * @return {object} {pass:boolean,text:string}
     */     
    numberValidate(list,fields){
      let result = {
        pass: true,
        text: '如下字段数据校验不通过！'
      }
      for(let i = 0; i < list.length; i ++){
        let row = ''
        for(let j = 0; j < fields.length; j ++){
          if(typeof list[i][fields[j].key] !== 'number'){
            result.pass = false
            row += row === '' ? `第${i+1}行：${fields[j].title}` : `、${fields[j].title}`
          }
          if(j===fields.length-1){
            result.text += row
          }
        }
      }
      result.text += ' 请更正后提交'
      return result
    },
    /**
     * 提交表单
     */
    billQuantitieSubmit(formBase) {
        let planProfitLossAnalyses = this.$clone(this.form.planProfitLossAnalyses);
        if(planProfitLossAnalyses.length>1){
            planProfitLossAnalyses.pop();  //去掉数组最后一行数据，就是合计
        }
        if (!planProfitLossAnalyses.length) {
        this.$message.warning('请至少填写一行数据')
        return
      } else {
        let everyFileInfo = planProfitLossAnalyses.every((item) => {
            let flag = !this.isEmpty(item.name) && !this.isEmpty(item.unitOfMeasurement) &&
            !this.isEmpty(item.bidQuantities) && !this.isEmpty(item.bidUnitPrice) && !this.isEmpty(item.bidTotalPrice) &&
            !this.isEmpty(item.costQuantities) && !this.isEmpty(item.costUnitPrice) && !this.isEmpty(item.costTotalPrice) &&
            !this.isEmpty(item.profitAndLoss) && !this.isEmpty(item.biddingStrategy) && !this.isEmpty(item.countermeasures)
          return flag
        })
        if (!everyFileInfo) {
          this.$message.warning('请完善表格数据')
          return
        }
      }
      const {pass,text} = this.numberValidate(planProfitLossAnalyses,[
        {
          key: 'bidQuantities',
          title: '投标价-工程量'
        },
        {
          key: 'bidUnitPrice',
          title: '投标价-单价(元)'
        },
        {
          key: 'costQuantities',
          title: '测算成本-核定工程量'
        },
        {
          key: 'costUnitPrice',
          title: '测算成本-单价(元)'
        }
      ])
      if(!pass){
        this.$message.warning(text)
        return
      }
      if (!this.validateForm()) {
        return
      }
      this.sure(2);
    },
    submitFn(status){
      let msg = status*1===2?"提交":"保存草稿";
      this.loading = true
       if(this.form.planProfitLossAnalyses.length>1){  //数组最后一项是合计项，将值赋给字段
         let planProfitLossAnalysesForm = this.form.planProfitLossAnalyses[this.form.planProfitLossAnalyses.length -1];
         this.form.bidTotal = planProfitLossAnalysesForm.bidQuantities;
         this.form.costTotal = planProfitLossAnalysesForm.costQuantities;
         this.form.profitAndLossTotal = planProfitLossAnalysesForm.profitAndLoss;
       }else if(this.form.planProfitLossAnalyses.length===1){
        let planProfitLossAnalyses = this.form.planProfitLossAnalyses[0];
         this.form.bidTotal = planProfitLossAnalyses.bidTotalPrice;
         this.form.costTotal = planProfitLossAnalyses.costTotalPrice;
         this.form.profitAndLossTotal = planProfitLossAnalyses.profitAndLoss;
       }else{
        this.form.bidTotal = null
         this.form.costTotal = null
         this.form.profitAndLossTotal = null
       }
      let form = this.$clone(this.form),
      planProfitLossAnalyses = form.planProfitLossAnalyses;
      form.auditStatus = status;
      form.isChange = this.pageType=='change'?1:0;  // 是编辑还是变更
      if(planProfitLossAnalyses.length>1){
       let objArrTwo =  planProfitLossAnalyses[planProfitLossAnalyses.length-1];
       if(!objArrTwo.bidTotalPrice){
         planProfitLossAnalyses.pop();
       }
        // for(let key in objArrTwo){
        //  objArrTwo[key]  = null
        //  }
      }
      let api = planProfitLossAnalysisEntityUpdateByPrimaryKeySelective
      api(form)
        .then(() => {
          this.loading = false
          this.$message.success(`${msg}成功！`);
          this.$multiTab.close()
        })
        .catch(() => {
          this.loading = false
          this.$message.warning(err.data.message)
        })
    },
    /**
     * @description: 递归扁平化表头并返回
     * @param {array} columns 表头
     * @param {string} parentTitle 父标题
     * @return {array}
     */
    flatColumns(columns, parentTitle = null) {
      const list = {}
      for (let i = 0; i < columns.length; i++) {
        if (columns[i]?.children || Array.isArray(columns[i].children)) {
          Object.assign(list, this.flatColumns(columns[i].children, parentTitle === null ? columns[i].title : parentTitle + '=>' + columns[i].title))
        } else {
          list[columns[i].dataIndex] = parentTitle === null ? columns[i].title : parentTitle + '=>' + columns[i].title
        }
      }
      return list
    },
    /**
     * @description: 前端解析excel导入
     * @param {Array} list 导入的列表
     * @return {void}
     */
    handleImport(list) {
      this.importLoading = true
      // 扁平化表头
      const head = this.flatColumns(this.columns.filter((el) => el.dataIndex !== 'index' && el.dataIndex !== 'action'))
      // excel返回数据合并后的表头字段及内容字段
      const importHead = [],
        importContent = []
      // 拆分excel返回数据表头和内容
      for (let i = 0; i < list.length; i++) {
        if (list[i].hasOwnProperty('序号')) {
          // 内容
          importContent.push(list[i])
        } else {
          // 合并后表头
          importHead.push(list[i])
        }
      }
      // 表格和导入excel表头对应
      const tableForExcel = {}
      const key = '__EMPTY'
      // 初步获取合并表头的路径
      for (let i = 0; i < importHead.length; i++) {
        let prefix = null
        for (let el in importHead[i]) {
          if (el.indexOf(key) < 0) {
            prefix = el
          }
          if (tableForExcel.hasOwnProperty(el)) {
            tableForExcel[el] = tableForExcel[el] + '=>' + importHead[i][el]
          } else {
            tableForExcel[el] = prefix !== null ? prefix + '=>' + importHead[i][el] : importHead[i][el]
          }
        }
      }
      // 补齐合并表头的路径
      for (let item in tableForExcel) {
        if (tableForExcel[item].indexOf('=>') < 0) {
          for (let i = Number(item.split(key+'_')[1]); i > 0; i--) {
            if (tableForExcel[key+'_' + i].indexOf('=>') > 0) {
              const arr = tableForExcel[key+'_' + i].split('=>')
              arr.pop()
              arr.push(tableForExcel[item])
              tableForExcel[item] = arr.join('=>')
              break
            }
          }
        }
      }
      // 表头对应
      for (let item in head) {
        for (let el in tableForExcel) {
          if (head[item] === tableForExcel[el]) {
            head[item] = el
          }
        }
      }
      const table = []
      // 修改字段名
      for (let i = 0; i < importContent.length; i++) {
        if (Object.keys(importContent[i]).length > 1) {
          const el = {}
          for (let item in head) {
            if (importContent[i].hasOwnProperty(head[item])) {
              el[item] = importContent[i][head[item]]
            }
          }
          table.push(el)
        }
      }
      this.isImport = true
      let arr = this.$clone(this.form.planProfitLossAnalyses)
      let tail = {}
      if(arr.length>=2){
        tail = arr.pop()
        this.form.planProfitLossAnalyses = [...arr,...table,tail]
      }else{
        this.form.planProfitLossAnalyses = [...arr,...table,{}]
      }
      this.importLoading = false
      this.calculate()
      this.$nextTick(()=>{
        this.isImport = false
      })
    }
  }
}
</script>
<style lang="less" scoped>
@deep: ~'>>>';
 .scene{
     display: block;
     margin: 10px 0 10px 60px;
     color: rgba(0, 0, 0, 0.85);
 }
@{deep} .planProfitLossAnalyses{
     .ant-form-item-label{
         width: 0;
     }
     .ant-form-item-control-wrapper{
         width: 100%;
     }
   }
 .rulesForm{
   @{deep} .ant-input, @{deep} .ant-input-number-input, @{deep} .ant-select .ant-select-selection{
     border-color: #e4ac0b;
     background-color: #FFF9E8;
   }
   @{deep} .ant-input[disabled]{
    background-color: #f5f5f5;
    border-color: #d9d9d9;
   }
   @{deep} .mandatory .ant-input{
      border-color: #d9d9d9;
     background-color: #fff;
   }
    @{deep} .ant-table-fixed .ant-table-tbody{
      tr{
          td:nth-last-child(2){
            .ant-input{
              background-color: #fff;
              border-color: #d9d9d9;
            }
          }
      }
   }
 }
@{deep} .lastTable .ant-table-fixed .ant-table-tbody{
      tr{
          &:last-child{
              background-color: #f5f5f5;
              .ant-input{
                 opacity: 0;
              }
              .ant-input[disabled] {
                opacity:1;
                border: none;
             }
          }
      }
   }
</style>
